import http from '../network/http'

export default {
  //获取所有章节小节信息
  getAllChapterVideo(subjectId){
    return http({
      url: `/xiyun/service/subject/chapter/getChapterVideo/${subjectId}`,
      method: 'get'
    })
  },
  //添加章节
  addChapter(chapter){
    return http({
      url: '/xiyun/service/subject/chapter/addChapter',
      method: 'post',
      data: chapter
    })
  },
  //删除章节
  delChapter(chapterId){
    return http({
      url: `/xiyun/service/subject/chapter/deleteChapter/${chapterId}`,
      method: 'get'
    })
  },
  //根据章节id获取章节信息
  getChapterInfo(chapterId){
    return http({
      url: `/xiyun/service/subject/chapter/getChapterInfo/${chapterId}`,
      method: 'get'
    })
  },
  //修改章节信息
  updateChapter(chapter){
    return http({
      url: '/xiyun/service/subject/chapter/updateChapter',
      method: 'put',
      data: chapter
    })
  }
}
